// pages/project/project.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    logo: {
      mode: "aspectFit",
      text: "lodsve-framework",
      src: "http://lodsve.github.io/lodsve-framework/imgs/logo.png"
    },
    wechat: {
      mode: "scaleToFill",
      text: "wechat",
      src: "http://lodsve.github.io/lodsve-framework/imgs/wechat.jpg"
    },
    alipay: {
      mode: "scaleToFill",
      text: "alipay",
      src: "http://lodsve.github.io/lodsve-framework/imgs/alipay.png"
    },
    contacts: [{
      name: 'ol',
      children: [{
        name: 'li',
        children: [{
          type: "text",
          text: 'Email: sunhao.java@gmail.com'
        }]
      }, {
        name: 'li',
        children: [{
          type: "text",
          text: 'QQ: 867885140'
        }]
      }, {
        name: 'li',
        children: [{
          type: "text",
          text: "Blog: Also see 'About me'"
        }]
      }]
    }],
    introduction: [{
      name: 'ol',
      children: [{
        name: 'li',
        children: [{
          type: 'text',
          text: "Base on some open source framework. It encapsulates some classes and methods to make more convenient for developers."
        }]
      },
      {
        name: 'li',
        children: [{
          type: 'text',
          text: "It consists of the following modules:"
        }]
      }]
    }],
    projects: [{
      name: 'ul',
      children: [{
        name: 'li',
        children: [{
          type: 'text',
          text: 'lodsve-3rd'
        }]
      }, {
        name: 'li',
        children: [{
          type: 'text',
          text: 'lodsve-amqp'
        }]
      }, {
        name: 'li',
        children: [{
          type: 'text',
          text: 'lodsve-cache'
        }]
      }, {
        name: 'li',
        children: [{
          type: 'text',
          text: 'lodsve-core'
        }]
      }, {
        name: 'li',
        children: [{
          type: 'text',
          text: 'lodsve-dubbo'
        }]
      }, {
        name: 'li',
        children: [{
          type: 'text',
          text: 'lodsve-fs'
        }]
      }, {
        name: 'li',
        children: [{
          type: 'text',
          text: 'lodsve-mongodb'
        }]
      }, {
        name: 'li',
        children: [{
          type: 'text',
          text: 'lodsve-mvc'
        }]
      }, {
        name: 'li',
        children: [{
          type: 'text',
          text: 'lodsve-mybatis'
        }]
      }, {
        name: 'li',
        children: [{
          type: 'text',
          text: 'lodsve-redis'
        }]
      }, {
        name: 'li',
        children: [{
          type: 'text',
          text: 'lodsve-search'
        }]
      }, {
        name: 'li',
        children: [{
          type: 'text',
          text: 'lodsve-security'
        }]
      }, {
        name: 'li',
        children: [{
          type: 'text',
          text: 'lodsve-test'
        }]
      }, {
        name: 'li',
        children: [{
          type: 'text',
          text: 'lodsve-validate'
        }]
      }, {
        name: 'li',
        children: [{
          type: 'text',
          text: 'lodsve-wechat'
        }]
      }, {
        name: 'li',
        children: [{
          type: 'text',
          text: 'lodsve-workflow'
        }]
      }]
    }]
  },

  showSrc: function (event) {
    wx.showModal({
      confirmText: "复制链接",
      title: event.target.dataset.title,
      content: event.target.dataset.href,
      success: function (res) {
        if (res.confirm) {
          wx.setClipboardData({
            data: event.target.dataset.href,
            success: function (res) {
              wx.showToast({
                title: '复制成功',
              })
            }
          })
        }
      }
    });
  },
  onShareAppMessage: function (res) {
    return {
      title: 'lodsve-framework',
      path: '/pages/project/project'
    }
  }
})